package com.ilancuo.test;

/**
 * Created by ilancuo on 2018/9/10.
 */
public class TryCatch1 {
    public static void main(String[] args) {
        divide(3, 0);
    }

    private static int divide(int x, int y) {
        try {
//            return x / y; // 返回后也会执行到finally块
            System.exit(0); // 执行后,不会执行到finally块,仅此一种方法 exit()方法中任意参数均可
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            System.out.println("This is in finally");
        }
        return 0;
    }
}
